;(function(window) {
    var ndeduDownload = {};
    /* 下载页 */
    ndeduDownload.onlineView = function() {
        var $onlineView = $('.btn-onlineview');
        //弹出一个iframe层
        $onlineView.click(function() {
            var pdfName = $(this).attr('title'),
                pdfId = $(this).attr('fileId'),
                articleId = $(this).attr('articleId');
            if (!pdfId) {
                layer.msg('文件不存在或被删除~');
                return
            }
            layer.open({
                type: 2,
                title: pdfName + '预览',
                shadeClose: true,
                shade: 0.8,
                area: ['90%', '90%'],
                content: '/pdf/view?resourceId=' + pdfId //iframe的url
            });
            $.ajax({
                method: 'get',
                url: '/api/article/setArticleLog?articleId=' + articleId,
                dataType: 'json'
            })
        });
    },
    window.ndeduDownload = ndeduDownload;
})(window);
$(function() {
    ndeduDownload.onlineView();
});
